package main

import "fmt"

// 接口的定义和调用
func intefactG() {
	fmt.Println()
	fmt.Println("=========someVar========")
	fmt.Println()

	var phone Phone
	phone = new(Nokia)
	phone.call()
	phone = new(IPhone)
	phone.call()
}

// phone接口
type Phone interface {
	call()
}

// nokia实现类
type Nokia struct {
}

func (nokia Nokia) call() {
	fmt.Println("Nokia")
}

// iphone实现类
type IPhone struct {
}

func (iPhone IPhone) call() {
	fmt.Println("IPhone")
}
